Lights and lit objects, set up in Gbabel's Lighting setting: a light cuts a hole in a room's darkness and tints what stands in it, with no code at all.
Room lighting makes a game look lit, and it is made entirely in Gbabel. An object gets a Lighting setting. One object is a light; another is lit by the lights. You choose how each looks in a window with a live picture, and you write nothing.


In the picture, the street lamp and the fire are lights. The walker is lit: in the lamp's cone he wears the lamp's colors, and he wore the fire's colors a moment before. Outside every light he wears his own. The room is a shrouded room (a dark one), and each light cuts a hole in that darkness in its own shape.
A light does two things at once, and an object can have either role, never both:
Every object's window has a Lighting choice, and Adjust... beside it whenever the choice is not None.
| Choice | The object |
|---|---|
| None | is an ordinary object. This is what every object starts as, and it costs nothing. |
| This is a light | is a lamp, a fire, a window, a headlight: a source of light. |
| Lit by room lights | is an actor the lights color: a character, an enemy, a prop. |
The choice belongs to the one object it is set on. An object made from a parent does not become a light because its parent is one.
Adjust... opens a window with the object's picture on the left and the settings on the right. The wheel zooms where the pointer is. Drag the light in the picture to say where it sits on the object. What the picture shows is exactly what the console will show, pixel for pixel: the room is dark and the light is a hole in the dark. There is no soft glow in it, because the console cannot draw one.
The edge of a light is a dither: a fine checker of lit and dark dots. The console has no soft fade for a cutout in its darkness, so a soft edge is a wider ring of dots. It is a texture, and it can look very good.
An object that is lit wears colors made for each light of the game (a light color at a strength; see Strength above), made ahead of time, so nothing is worked out while it plays. It is lit only while its body is inside a light's shape. A lit object near the camera looks for the nearest light a few times a second, not every frame, so it follows a light with a short delay and costs very little.
Quality says how finely it is lit, and the window shows what each costs on the cartridge before you pick:
| Quality | What you see | Palettes for each light color and strength |
|---|---|---|
| Low | lit or not lit: one change of colors | 1 |
| Medium | the lit colors fade in over three steps as it moves into the light | 3 |
| High | also lit from one side: the side that faces the light is lit, the other not, and full light when it is under the light | 5, and two more pictures of the object |
Preview shows the object under any light of your game (a color, with its strength when it is not 100%) at any depth into the light. Lit colors shows the colors it wears under each light. Click one to touch it up, right-click to put it back, or press Undo touch-ups to put them all back. A touched-up color is kept with the object.
An object lit by room lights has one set of colors to light: its Palette setting, or else the colors of its own picture. A High object's picture must fit fifteen colors once its lit and shaded colors are counted; Gbabel joins the nearest ones and says how many. An object that draws itself in a Draw event of its own is lit by its three steps only.
A sprite effect's Tint on a lit object is mixed over its own colors, not the light's; the Tint does not change with the light. The object keeps its Tint steady while it stands in a light, walks out of it or crosses into another, and a Tint that is held does not fade or flicker as the light looks at the object again. When the Tint ends, the object wears the colors its light gives it. See sprite_effect_start.
The console can show sixteen sprite palettes at once, and every lit color uses one. A room with many lit objects and many lights can ask for more than it has. Gbabel adds up what a room could need, its own pictures and the lit colors of each lit object under each light in the room, and says so in the Problems list when the sum passes sixteen. A light counts by its color and its strength together: two lights of the same color at the same strength share their palettes, but the same color at two strengths needs a set for each. Fewer light colors or strengths, a lower quality or fewer lit objects bring it back.
The Room Editor draws the area each light lights, faintly, where the object is placed. It is the Light areas row of Layers, on by default, and it is never part of the game.
A shrouded room is dark everywhere; lights are what let you see. A light cuts its hole in the shroud in its own shape, size and edge, and a light that is turned, scaled or switched off with the calls below moves its hole with it. In a room that is not shrouded there is no darkness to cut, so the same lights only color the objects that stand in them.
A light's shape, size, edge and color are chosen in Gbabel. Four calls change what is set, while the game runs, from the light's own events:
| Call | What it does |
|---|---|
light_on | switches the light on or off |
light_rotate | points it in another direction |
light_scale | makes it bigger or smaller about its own origin |
light_flicker | makes it waver, or hold steady |
Colors are never changed from code. All four do nothing on an object that is not set as a light.
shroud_cutout and shroud_cutout_sprite are the older, simpler way. They cut a hole in a shrouded room's darkness, made on the fly from code, in a circle or in the shape of any sprite you hand them, on any object at any moment. They light nothing, and they do nothing in a room that is not shrouded.
A light you set in Gbabel does that and more: it also colors the objects that stand in it. Use the Lighting setting for a lamp, a fire or a window that is part of a place. Use a cutout when the hole must be made on the fly and cannot be set in a window: a hole that takes the shape of a sprite you pick while the game plays, for example.
A light uses one of the console's sprite windows to cut its hole, and a turned or scaled light spends one of its rotation and scaling slots while lit (see Budgets). A lit object costs about three quarters of a thousand processor cycles a frame in a game with lights, out of about 280,000 in a frame; High costs about three hundred more than Medium. The window and the build say what the lit colors and pictures add to the cartridge.
The Room Lights example in the New Project gallery is a street at night: a street lamp that stutters out and sways, a fire that flares, and a walker, lit at High quality, who walks through both. Open its objects to see how each is set up.